package zuoye29.zuoye3;

import java.util.regex.Pattern;

public class zuoye3 {
    public static void main(String[] args) {
        String input = "张洋.rar";
        String regex = "^[\\u4e00-\\u9fa5]+\\.[a-zA-Z]{2,4}$";
        Pattern pattern = Pattern.compile(regex);
        boolean isValid = pattern.matcher(input).matches();
        System.out.println("作业名称是否正确：" + isValid);
    }
}
